function DescShow(){
	$("#tbkDescShow").toggle(
		function () { $("#tbkDesc").show();},
		function () { $("#tbkDesc").hide(); }
	); 
	
	var detail = "<a href=\"" +$("#tbkBuy a").attr('href')+ "\"><img src=\"http://taoke.alimama.com/images/cps/fgetccode_btn.gif\" /></a>";
	$(".pinfoshow span:first").after(detail);
	$("#tbkShop span:first").after(detail);
	
} //END func DescShow


function Tooltip(){
	var x = 15;
	var y = -50;
	$("a.tbkTooltip").mouseover(function(e){
		var pic_url = $(this).children().attr("src"); 
		
		this.myTitle = this.title;
		this.title = "";	
		var imgTitle = this.myTitle? "<br/>" + this.myTitle : "";
		var tooltip = "<div id='tbkTooltip'><img src='"+ pic_url +"' alt='产品预览图'/>"+imgTitle+"<\/div>"; //创建 div 元素
		$("body").append(tooltip);	//把它追加到文档中						 
		$("#tbkTooltip")
			.css({
				"top": (e.pageY+y) + "px",
				"left":  (e.pageX+x)  + "px"
			}).show("fast");	  //设置x坐标和y坐标，并且显示
    }).mouseout(function(){
		this.title = this.myTitle;	
		$("#tbkTooltip").remove();	 //移除 
    }).mousemove(function(e){
		$("#tbkTooltip")
			.css({
				"top": (e.pageY+y) + "px",
				"left":  (e.pageX+x)  + "px"
			});
	});
} //END func Tooltip

function DrawImg(boxWidth,boxHeight) {
	var imgWidth=$("#tbkPic").width();
	var imgHeight=$("#tbkPic").height();
	//比较imgBox的长宽比与img的长宽比大小
	if((boxWidth/boxHeight)>=(imgWidth/imgHeight)) {
		//重新设置img的width和height
		$("#tbkPic").width((boxHeight*imgWidth)/imgHeight);
		$("#tbkPic").height(boxHeight);
		//让图片居中显示
		var margin=(boxWidth-$("#tbkPic").width())/2;
		$("#tbkPic").css("margin-left",margin);
	}else {
		//重新设置img的width和height
		$("#tbkPic").width(boxWidth);
		$("#tbkPic").height((boxWidth*imgHeight)/imgWidth);
		//让图片居中显示
		var margin=(boxHeight-$("#tbkPic").height())/2;
		$("#tbkPic").css("margin-top",margin);
	}
} //ENF func DrawImg



